﻿@page "/setting-management"
@using Microsoft.AspNetCore.Authorization
@using Volo.Abp.AspNetCore.Components.Web.Theming.Layout
@using Volo.Abp.Features
@attribute [Authorize]
@attribute [RequiresFeature(SettingManagementFeatures.Enable)]
@using Microsoft.Extensions.Localization
@using Volo.Abp.UI.Navigation.Localization.Resource
@inject IStringLocalizer<AbpUiNavigationResource> LUiNavigation
@* ************************* PAGE HEADER ************************* *@
<PageHeader Title="@L["Settings"]" BreadcrumbItems="@BreadcrumbItems">

</PageHeader>

<Card>
    <CardBody Class="pt-3">
        @if (!string.IsNullOrEmpty(SelectedGroup))
        {
            <Tabs @bind-SelectedTab="@SelectedGroup" TabPosition="TabPosition.Start" Pills="true" RenderMode="TabsRenderMode.LazyReload" VerticalItemsColumnSize="ColumnSize.Is3.OnDesktop.Is6.OnTablet.Is12.OnMobile">
                <Items>
                    @foreach (var group in SettingComponentCreationContext.Groups)
                    {
                        <Tab Name="@GetNormalizedString(group.Id)">
                            @group.DisplayName
                        </Tab>
                    }
                </Items>
                <Content>
                    @foreach (var group in SettingComponentCreationContext.Groups)
                    {
                        <TabPanel Name="@GetNormalizedString(group.Id)" class="abp-md-form">
                            @{
                                SettingItemRenders.Add(builder =>
                                {
                                    builder.OpenComponent(0, group.ComponentType);
                                    builder.CloseComponent();
                                });
                            }

                            @SettingItemRenders.Last()
                        </TabPanel>
                    }
                </Content>
            </Tabs>
        }
    </CardBody>
</Card>
